<?php
/**
 * Project: Recipe
 * File: RecipeArticleModel.class.php
 * Author: Xnfy520@gmail.com
 * Date: 12-5-24
 * Time: 下午3:06
 */
	class RecipeArticleModel extends RelationModel{

		protected $_link = array(

			'User'=>array(
				'mapping_type'=>BELONGS_TO,
				'mapping_name'=>'userinfo',
				'class_name'=>'User',
				'foreign_key'=>'founder',
			),

			'RecipeCategory'=>array(
				'mapping_type'=>BELONGS_TO,
				'mapping_name'=>'recipecategory',
				'class_name'=>'RecipeCategory',
				'foreign_key'=>'recipecategoryid',
			),

			'RecipeMain'=>array(
				'mapping_type'=>HAS_MANY,
				'mapping_name'=>'recipemain',
				'class_name'=>'RecipeMain',
				'foreign_key'=>'recipearticleid',
				'condition'=>'recipetypeid=1'
			),

			'RecipeAccessory'=>array(
				'mapping_type'=>HAS_MANY,
				'mapping_name'=>'recipeaccessory',
				'class_name'=>'RecipeAccessory',
				'foreign_key'=>'recipearticleid',
				'condition'=>'recipetypeid=1'
			),

			'RecipeCondiment'=>array(
				'mapping_type'=>HAS_MANY,
				'mapping_name'=>'recipecondiment',
				'class_name'=>'RecipeCondiment',
				'foreign_key'=>'recipearticleid',
				'condition'=>'recipetypeid=1'
			),


		);

	}